Skip to content

feat(outbox): produce outbox proofs#808

Merged
victor-dumitrescu merged 4 commits intomainfrom
vdum/rv-877
Feb 17, 2026
Merged

feat(outbox): produce outbox proofs#808
victor-dumitrescu merged 4 commits intomainfrom
vdum/rv-877

Conversation

@victor-dumitrescu
Copy link
Copy Markdown
Contributor

@victor-dumitrescu victor-dumitrescu commented Feb 11, 2026

Closes RV-872. Closes RV-877.

What

The outbox can now produce a proof for an outbox message. A proof contains the message metadata and a Merkle proof which ties the inclusion of the given message in the outbox with a particular state hash.

Why

The outbox needs to support inclusion proofs for messages.

How

The OutboxProof type is introduced, along with Output and OutputInfo, which model Tezos protocol types.

Outbox proofs employ the same proof production mechanism used for fraud proofs. The difference is that the proven state transition is not one step of the PVM but a successful read of the given message from the outbox. The outbox is thus also expanded with the ability to read a single message.

Manually Testing

make all

In particular, the test_outbox_proofs_dummy_kernel test.

Regressions

A regression for an outbox proof for the first message of the last level of the dummy kernel is checked in.

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages in agreement with our guidelines.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 95.30792% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.12%. Comparing base (80bfe8b) to head (f0c9b7b).

Files with missing lines Patch % Lines
src/riscv/lib/src/pvm/node_pvm.rs 0.00% 10 Missing ⚠️
src/riscv/lib/src/pvm/outbox.rs 98.68% 3 Missing and 1 partial ⚠️
src/riscv/lib/src/pvm/common.rs 88.88% 0 Missing and 1 partial ⚠️
src/riscv/lib/src/stepper/pvm.rs 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #808      +/-   ##
==========================================
+ Coverage   91.08%   91.12%   +0.03%     
==========================================
  Files         111      111              
  Lines       20964    21285     +321     
  Branches    20964    21285     +321     
==========================================
+ Hits        19096    19396     +300     
- Misses       1491     1510      +19     
- Partials      377      379       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@victor-dumitrescu victor-dumitrescu force-pushed the vdum/rv-877 branch 2 times, most recently from 76fdfcc to 0886566 Compare February 11, 2026 10:32
@victor-dumitrescu victor-dumitrescu marked this pull request as ready for review February 11, 2026 10:47
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 11, 2026

Benchmark results for revision 447c8e4:

Metric Duration TPS
Mean 1.522392966s 26.276
Worst 1.5470546s 25.856
Best 1.501283435s 26.644
Standard Deviation ±10.524011ms ±0.181
Full results
Run Transfers Duration TPS
1 40 1.5470546s 25.856
2 40 1.519383365s 26.326
3 40 1.523412593s 26.257
4 40 1.526256451s 26.208
5 40 1.525619466s 26.219
6 40 1.522931726s 26.265
7 40 1.524953239s 26.230
8 40 1.545219464s 25.886
9 40 1.505672518s 26.566
10 40 1.517070447s 26.367
11 40 1.529345649s 26.155
12 40 1.528842934s 26.164
13 40 1.521224837s 26.295
14 40 1.514406221s 26.413
15 40 1.524819372s 26.233
16 40 1.512844931s 26.440
17 40 1.521002984s 26.298
18 40 1.519199421s 26.330
19 40 1.501283435s 26.644
20 40 1.517315676s 26.362

Compare the results above with those for the default branch.

@emturner
Copy link
Copy Markdown
Contributor

Mean 1.543554521s 25.915

There seems to be a performance drop, perhaps?

Copy link
Copy Markdown
Contributor

@emturner emturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall LGTM

@victor-dumitrescu victor-dumitrescu force-pushed the vdum/rv-877 branch 4 times, most recently from 592faa4 to 01886c1 Compare February 12, 2026 14:07
Copy link
Copy Markdown
Contributor

@thomasathorne thomasathorne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks great!

Have a few questions about the different error cases and how they are currently tested (or not tested). I may have misunderstood something as some of the errors output in the tests aren't what I expected! 😅 At any rate, the different cases could be clarified a bit.

@victor-dumitrescu victor-dumitrescu force-pushed the vdum/rv-877 branch 2 times, most recently from fec1f02 to ec13689 Compare February 13, 2026 09:16
@victor-dumitrescu
Copy link
Copy Markdown
Contributor Author

Mean 1.543554521s 25.915

There seems to be a performance drop, perhaps?

This PR now also contains a small PVM state restructuring which @emturner discovered offsets the slight dip in performance.

@victor-dumitrescu
Copy link
Copy Markdown
Contributor Author

Ok, I've understood the different error cases now---sorry for my confusion earlier.

I still think if you want to make it really clear what is being tested in each case, adding a few more cases to the OutboxProofError enum would help. Unless I am missing something I think there are still two cases that aren't tested: the case where the outbox is uninitialised and the case where we try to read from a level that doesn't exist yet.

I've added tests for these cases here.

Splitting LevelNotFound into three cases (OutboxUninitialised, LevelTooOld and LevelNotReachedYet) would clarify this.

But this is more a stylistic choice than anything else, happy for you to resolve this comment if you want.

I'd rather not overcomplicate this error type. As for clarity of the code, I think each instance of raising LevelNotFound is now documented with the cause.

@victor-dumitrescu victor-dumitrescu added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 13590c2 Feb 17, 2026
8 checks passed
@victor-dumitrescu victor-dumitrescu deleted the vdum/rv-877 branch February 17, 2026 15:02
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 95.30792% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.12%. Comparing base (80bfe8b) to head (f0c9b7b).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/riscv/lib/src/pvm/node_pvm.rs 0.00% 10 Missing ⚠️
src/riscv/lib/src/pvm/outbox.rs 98.68% 3 Missing and 1 partial ⚠️
src/riscv/lib/src/pvm/common.rs 88.88% 0 Missing and 1 partial ⚠️
src/riscv/lib/src/stepper/pvm.rs 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #808      +/-   ##
==========================================
+ Coverage   91.08%   91.12%   +0.03%     
==========================================
  Files         111      111              
  Lines       20964    21285     +321     
  Branches    20964    21285     +321     
==========================================
+ Hits        19096    19396     +300     
- Misses       1491     1510      +19     
- Partials      377      379       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants